import Cookies from 'js-cookie'
const TokenKey = 'Admin-Token'

export function getToken() {
  return Cookies.get(TokenKey)
}

//在当前时间的基础上增加24小时
const expirationTime = new Date();
expirationTime.setTime(expirationTime.getTime() + 24 * 60 * 60 * 1000);
export function setToken(token) {
  return Cookies.set(TokenKey, token, { expires: expirationTime })
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
